<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/jquery.min.js"></script>
	</head>
	<body>
		<h1>写死JSON，解析JSON字符串把价格和ID展现页面上</h1>
				
		<div>编号：<span id="itemId"></span></div>
		<div>价格：<span id="itemPrice"></span></div>
	</body>
	<script>
		var jsonstr='[{"p":"4879.00","op":"5299.00","cbf":"0","id":"J_100008348542","m":"6000.00"}]';
		console.log(jsonstr);
		
		var items=JSON.parse(jsonstr);
		console.log(items[0]);
		console.log(items[0].p);
		console.log(items[0].id);
		
		$("#itemId").text(items[0].id);
		$("#itemId").css("color","blue");
		
		$("#itemPrice").text(items[0].p);
		$("#itemPrice").css("color","red");
	</script>
</html>
